<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <link rel="stylesheet" href="<%=path%>/css/common.css" type="text/css" />
<link rel="stylesheet" href="<%=path%>/css/innerstyle.css" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=path%>/css/ui-lightness/jquery-ui-1.8.23.custom.css" />
<script type="text/javascript" src="<%=path%>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=path%>/js/json2.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.validate.min.js"></script>



<SCRIPT language=javascript type=text/javascript>

  $(function(){
  $("#but1").button();
  ol();
  });
     
   function ol() {
   	$("#but1").click(function(){
		    if($("#form1").valid()){
		       var flag = true;
		       var msg = "";
		       if(document.getElementById("tbNewPassWord").value==""){
		           msg ="请输入新密码!";
		           flag = false;
		        }
		        else if(document.getElementById("tbNewPassWord1").value==""){
		           msg ="请再次确认新密码!";
		           flag =  false;
		        }		       
		        else if(document.getElementById("tbNewPassWord").value!=document.getElementById("tbNewPassWord1").value){
		           msg ="两次密码不一致!";
		           flag =  false;
		        } 
		        
		        if(flag){
		        var url = "<%=path%>/login/resetPwd.action";
		         $("#form1").ajaxSubmit({
		              url:url,
		              type:'post',
		              success:function(data){
		              var json =eval('(' + data + ')');
					    if(json.result==1){
					    alert("修改密码成功！");
					    logut();					   
					   }else{
					    alert("修改密码失败！");
					    //window.returnValue=1;
                        //window.close();
					   }
		              }
		         });	
		        }else{
		          alert(msg);
		        }
		        	       
		        
		        }
		       });
   }
   
   function logut(){
       window.location.href="<%=request.getContextPath()%>/login/logout.action";
   }
   
   
    </SCRIPT>
  </head>
  
  <BODY>
 
<FORM id="form1" method="post" name="form1"   >
 <div    id="best1">
   <table  border="0" class="datalist"  >
     <span style="color: red;font-size:12px;vertical-align:middle;">1：为了保证您的账户安全，请先修改您的普通登陆密码。密码规则为6位及以上数字和字母组合。</span><br>
     <span style="color: red;font-size:12px;vertical-align:middle;">2：近期入市代表、交易员、结算员将全面禁用【普通登陆】，请尽快使用密钥登陆。</span>
     <tr>
       <td align="right">新密码:</td>
       <td>  <INPUT id="tbNewPassWord" class="txtStyle" name="newPassWord" type="password"> </td>
     </tr>
     <tr class="altrow">
       <td align="right">确认新密码:</td>
       <td><INPUT id="tbNewPassWord1" class="txtStyle" name="password1" type="password"></td>
     </tr>
     <tr><td align="right"></td>
       <td  align="left" ><INPUT id="but1"  type="button" value="提交" > </td>
      </tr>     
   </table>
 </div>
</FORM></BODY>
</html>
